﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.UI.DataVisualization.Charting;

namespace WebSite.admin.Report
{
    public partial class ColumnCylinder3D : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Chart1.Titles[0].Text = string.Empty;
        }
        public void DrawingGraph(string sTitle,string[] colorNames, string[] xNames, double[] yVal1, double[] yYal2, double[] yVal3)
        {
            lblName1.Text = colorNames[0];
            lblName2.Text = colorNames[1];
            lblName3.Text = colorNames[2];
            // Set Cylinder drawing style attribute
            Chart1.Series["Series1"]["DrawingStyle"] = "Cylinder";
            Chart1.Series["Series2"]["DrawingStyle"] = "Cylinder";
            Chart1.Series["Series3"]["DrawingStyle"] = "Cylinder";

            Chart1.Series["Series1"]["PointWidth"] = "0.4";
            Chart1.Series["Series2"]["PointWidth"] = "0.4";
            Chart1.Series["Series3"]["PointWidth"] = "0.4";

            Chart1.Series["Series1"].ChartType = SeriesChartType.Column;
            Chart1.Series["Series2"].ChartType = SeriesChartType.Column;
            Chart1.Series["Series3"].ChartType = SeriesChartType.Column;
            Chart1.Titles[0].Text = sTitle;

            // Set clustered flag
            Chart1.ChartAreas["ChartArea1"].Area3DStyle.IsClustered = false;

            // Set points depth
            Chart1.ChartAreas["ChartArea1"].Area3DStyle.PointDepth = 100;

            Chart1.ChartAreas["ChartArea1"].Area3DStyle.PointGapDepth = 100;

          //  double[] yval = { 200, 600, 400, 500, 300, 500, 550, 600, 650, 1000, 1200, 300 };
            //string[] xval = { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", };
            Chart1.Series["Series1"].Points.DataBindXY(xNames, yVal1);
          //  double[] yval2 = { 190, 500, 200, 400, 288, 350, 520, 580, 600, 800, 100, 0 };
            Chart1.Series["Series2"].Points.DataBindXY(xNames, yYal2);
           // double[] yval3 = { 0, 30, 10, 0, 12, 10, 20, 0, 50, 10, 500, 0 };
            Chart1.Series["Series3"].Points.DataBindXY(xNames, yVal3);
        }
    }
}